package com.njlime.cms.service.app;

import com.njlime.cms.entities.InformationComment;
import com.njlime.cms.entities.InformationMotion;
import com.njlime.cms.repository.app.AppInformationCommentDao;
import com.njlime.cms.repository.app.AppInformationMotionDao;
import com.njlime.core.helper.PageBean;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.Date;
import java.util.Map;

/**
 * Created by Dean on 2017/10/10.
 */

@Service
public class AppInformationMotionService {
    @Resource
    private AppInformationMotionDao appInformationMotionDao;

    /**
     * 保存热点评论
     */
    @Transactional(readOnly = false)
    public void save(InformationMotion informationMotion) {
        appInformationMotionDao.save(informationMotion);

    }

    /**
     * 获取最多情绪
     * @param id
     * @return
     */
    public Map<String,Object> getMostMotion(Integer id){
        return appInformationMotionDao.getMostMotion(id);
    }

    /**
     * 详情
     * @param id
     * @param user_id
     * @return
     */
    public InformationMotion getInformationMotion(Integer id,Integer user_id){
        return appInformationMotionDao.getInformationMotion(id,user_id);
    }

}
